package com.qeng.aiwanba.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.WindowManager;

import com.qeng.aiwanba.R;
import com.umeng.message.PushAgent;
import com.umeng.socialize.UMShareAPI;

/**
 * Created by lixy on 2017/9/26.
 */

public class BaseActivity extends Activity {
    private int mStartAnimEnter = R.anim.push_left_in;
    private int mStartAnimExit = R.anim.push_left_out;
    private int mFinishAnimEnter = R.anim.push_right_in;
    private int mFinishAnimExit = R.anim.push_right_out;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        overridePendingTransition(mStartAnimEnter, mStartAnimExit);
        //透明状态栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

        getWindow().setFlags( WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);

        PushAgent.getInstance(this).onAppStart();

        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        /** attention to this below ,must add this**/
        UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
    }

    @Override
    protected void onDestroy() {
        overridePendingTransition(mFinishAnimEnter, mFinishAnimExit);
        UMShareAPI.get(this).release();
        super.onDestroy();
    }
}
